#pragma once

#include <iostream>
#include <fstream> 
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
struct DetectResult {
    int classId;
    float score;
    cv::Rect box;
};

class YOLOv5Detector {
public:
    void initConfig(string onnxpath, string classpath, int iw, int ih, float threshold);
    void detect(Mat& frame, vector<DetectResult>& result);
    vector<string> readClassNames(string classpath);
private:
    int input_w = 640;
    int input_h = 640;
    cv::dnn::Net net;
    int threshold_score = 0.25;
    vector<string> class_list;
};